package com.xmall.search.service.other;

import com.xmall.define.base.BasePageQueryRequest;
import com.xmall.define.dto.es.EsBaseDto;
import com.xmall.search.define.callback.*;

import java.util.List;

public interface IElasticSearchService {

    /**
     * 更新索引映射
     */
    void updateMapping(String index, PutMappingBuilderCallback builder);

    /**
     * 保存
     */
    List<Long> save(String index, List<? extends EsBaseDto> requestList);

    /**
     * 删除
     */
    void delete(String index, DeleteRequestBuilderCallback callback);

    /**
     * 总数
     */
    Long count(String index, BasePageQueryRequest request, CountRequestBuilderCallback requestCallback);

    /**
     * 分页列表
     */
    void listPage(String index, BasePageQueryRequest request, SearchRequestBuilderCallback requestCallback, ResponseCallback responseExtract, Class cls);

}
